package com.model;
// default package

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;


/**
 * Student entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="db_student"
    ,catalog="acmctgu"
)

public class Student  implements java.io.Serializable {


    // Fields    

     private Integer id;
     private Clazz clazz;
     private String username;
     private String password;
     private String stuname;


    // Constructors

    /** default constructor */
    public Student() {
    }

    
    /** full constructor */
    public Student(Clazz clazz, String username, String password, String stuname) {
        this.clazz = clazz;
        this.username = username;
        this.password = password;
        this.stuname = stuname;
    }

   
    // Property accessors
    @GenericGenerator(name="generator", strategy="increment")@Id @GeneratedValue(generator="generator")
    
    @Column(name="id", unique=true, nullable=false)

    public Integer getId() {
        return this.id;
    }
    
    public void setId(Integer id) {
        this.id = id;
    }
	@ManyToOne(fetch=FetchType.EAGER)
        @JoinColumn(name="classid")

    public Clazz getClazz() {
        return this.clazz;
    }
    
    public void setClazz(Clazz clazz) {
        this.clazz = clazz;
    }
    
    @Column(name="username", length=30)

    public String getUsername() {
        return this.username;
    }
    
    public void setUsername(String username) {
        this.username = username;
    }
    
    @Column(name="password", length=30)

    public String getPassword() {
        return this.password;
    }
    
    public void setPassword(String password) {
        this.password = password;
    }
    
    @Column(name="stuname", length=30)

    public String getStuname() {
        return this.stuname;
    }
    
    public void setStuname(String stuname) {
        this.stuname = stuname;
    }
   








}